import request from '@/utils/request'

// 供应商商品、列表
export function getList(data) {
  return request({
    url: '/externalGoods/goods',
    method: 'get',
    params: data
  })
}

// 下载模板
export function downTemplate(data) {
  return request({
    url: '/externalGoods/tenantOrders/downTemplate',
    method: 'post',
    data: data
  })
}

// 列表展示
export function getRemoteList(data) {
  return request({
    url: '/externalGoods/goods/remote',
    method: 'get',
    params: data
  })
}

// 选择后添加
export function goodsSync(data) {
  return request({
    url: '/externalGoods/goods/sync',
    method: 'post',
    data
  })
}

export function postGoods(data) {
  return request({
    url: '/externalGoods/goods',
    method: 'post',
    data
  })
}

export function postTenantGoods(data) {
  return request({
    url: '/externalGoods/tenantGoods',
    method: 'post',
    data
  })
}

export function editGoods(id, data) {
  return request({
    url: '/externalGoods/goods/' + id,
    method: 'put',
    data
  })
}

export function modifyInfo(id, data) {
  return request({
    url: '/externalGoods/tenantOrders/modifyInfo/' + id,
    method: 'put',
    data
  })
}

export function editTenantGoods(id, data) {
  return request({
    url: '/externalGoods/tenantGoods/' + id,
    method: 'put',
    data
  })
}

export function delGoods(id) {
  return request({
    url: '/externalGoods/goods/' + id,
    method: 'delete'
  })
}

// 渠道商商品、列表
export function getTenantList(data) {
  return request({
    url: '/externalGoods/tenantGoods',
    method: 'get',
    params: data
  })
}

export function addSyncQekjTask(data) {
  return request({
    url: '/externalGoods/tenantGoods/addSyncQekjTask',
    method: 'post',
    data
  })
}

export function dealSyncQekjTask(data) {
  return request({
    url: '/externalGoods/tenantGoods/dealSyncQekjTask',
    method: 'post',
    data
  })
}

export function dealSingleGoodsSyncQekj(data) {
  return request({
    url: '/externalGoods/tenantGoods/dealSingleGoodsSyncQekj',
    method: 'post',
    data
  })
}

export function getTenantRemoteList(data) {
  return request({
    url: '/externalGoods/tenantGoods/select',
    method: 'get',
    params: data
  })
}

// 选择后添加
export function goodsTenantSync(data) {
  return request({
    url: '/externalGoods/tenantGoods/addSelect',
    method: 'post',
    data
  })
}

export function delTenantGoods(id) {
  return request({
    url: '/externalGoods/tenantGoods/' + id,
    method: 'delete'
  })
}

// 日志列表
export function getNotifyList(data) {
  return request({
    url: '/externalGoods/notify',
    method: 'get',
    params: data
  })
}

// 日志列表
export function triggerGoods(data) {
  return request({
    url: '/externalGoods/notify/triggerGoods',
    method: 'post',
    data
  })
}

// 新日志列表
export function getNewNotifyList(data) {
  return request({
    url: '/externalGoods/newNotify',
    method: 'get',
    params: data
  })
}

// 分类
export function getCategory(data) {
  return request({
    url: '/externalGoods/category',
    method: 'get',
    params: data
  })
}

// 设置禁用分类
export function setDisableCategories(data) {
  return request({
    url: '/externalGoods/category/disableCategories',
    method: 'post',
    data
  })
}

// 获取禁用分类
export function getDisableCategories() {
  return request({
    url: '/externalGoods/category/disableCategories',
    method: 'get'
  })
}

// 分类
export function getCreditList(data) {
  return request({
    url: '/externalGoods/credit',
    method: 'get',
    params: data
  })
}

// 渠道商列表
export function getTenantOrdersList(data) {
  return request({
    url: '/externalGoods/tenantOrders',
    method: 'get',
    params: data
  })
}

// 变更订单信息
export function orderInfo(data) {
  return request({
    url: '/externalGoods/tenantOrders/edit',
    method: 'post',
    data
  })
}

// 查看数据接口
export function apiOrderDetail(data) {
  return request({
    url: '/externalGoods/tenantOrders/apiOrderDetail/' + data,
    method: 'get'
  })
}

// 查看数据接口
export function apiOrderDetail_new(data) {
  return request({
    url: '/externalGoods/tenantOrders/apiOrderDetail_new/' + data,
    method: 'get'
  })
}

export function modifyOrder(data) {
  return request({
    url: '/externalGoods/tenantOrders/modifyOrder/' + data.id,
    method: 'post',
    data
  })
}

export function orderApplyPush(data, id) {
  return request({
    url: '/externalGoods/tenantOrders/customsApply/' + id,
    method: 'post',
    data
  })
}

export function orderXsRefund(data, id) {
  return request({
    url: '/externalGoods/tenantOrders/xsRefund/' + id,
    method: 'post',
    data
  })
}

export function createOrder(data, id) {
  return request({
    url: '/externalGoods/tenantOrders/createOrder/' + data,
    method: 'post'
  })
}

export function apiSaleOrder(data, id) {
  return request({
    url: '/externalGoods/tenantOrders/apiSaleOrder/' + data,
    method: 'post'
  })
}

export function apiPrepay(data, id) {
  return request({
    url: '/externalGoods/tenantOrders/yfkApply/' + data,
    method: 'post'
  })
}

export function queryOrder(id) {
  return request({
    url: '/externalGoods/tenantOrders/queryOrder/' + id,
    method: 'get'
  })
}

// 新闻列表
export function newsList(data) {
  return request({
    url: '/externalGoods/news',
    method: 'get',
    params: data
  })
}

// 获取新闻详情
export function getNewsDetail(id) {
  return request({
    url: '/externalGoods/news/' + id,
    method: 'get'
  })
}

// 新闻列表
export function newsListsb(data) {
  return request({
    url: '/api/news1',
    method: 'get',
    params: data
  })
}

// 新闻列表
export function newsList1(data) {
  return request({
    url: '/externalGoods/news1',
    method: 'get',
    params: data
  })
}

// 新闻列表
export function newsList2(data) {
  return request({
    url: '/externalGoods/news2',
    method: 'get',
    params: data
  })
}

// 新闻修改
export function editNews(id, data) {
  return request({
    url: '/externalGoods/news/' + id,
    method: 'put',
    data
  })
}

// 新闻删除
export function deleteNews(id) {
  return request({
    url: '/externalGoods/news/' + id,
    method: 'delete'
  })
}

// 新闻发布
export function publishNews(data) {
  return request({
    url: '/externalGoods/news/publish',
    method: 'post',
    data
  })
}

// 临时商品审查页面
export function tempGoods(goods_spu) {
  return request({
    url: '/api/news/tempGoods/' + goods_spu,
    method: 'get'
  })
}

// 临时商品审查页面
export function tempGoods2(goods_spu) {
  return request({
    url: '/api/news/tempGoods2/' + goods_spu,
    method: 'get'
  })
}

// 订单导入
export function importOrder2(data) {
  return request({
    url: '/externalGoods/tenantOrders/import2',
    method: 'post',
    data
  })
}

// 订单导出
export function exportOrders(data) {
  return request({
    url: '/externalGoods/tenantOrders/exportOrders',
    method: 'post',
    data
  })
}

// 订单导出
export function exportTenantGoods(data) {
  return request({
    url: '/externalGoods/tenantGoods/exportGoods',
    method: 'post',
    data
  })
}

// 获取订单表体模板列表
export function getManifestTemplateList() {
  return request({
    url: '/externalGoods/manifest/template/list',
    method: 'get'
  })
}

// 保存订单表体模板
export function saveManifestTemplate(data) {
  return request({
    url: '/externalGoods/manifest/template/save',
    method: 'post',
    data
  })
}

// 删除订单表体模板
export function deleteManifestTemplate(data) {
  return request({
    url: '/externalGoods/manifest/template/delete',
    method: 'post',
    data
  })
}

// 新增新闻
export function addNews(data) {
  return request({
    url: '/externalGoods/news',
    method: 'post',
    data
  })
}
